package cn.wolfcode.crm.web.controller;

import cn.wolfcode.crm.domain.Robot;
import cn.wolfcode.crm.serivce.IRobotService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("robot")
public class RobotController {
    @Autowired
    private IRobotService robotService;

    @RequestMapping("view")
    public String view(){
        return "robot";
    }

    @RequestMapping("talk")
    @ResponseBody
    public Robot talk(String keyword){
        return robotService.selectByRequest(keyword);
    }

}
